import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/home/index'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
      children:[
        {
          path: '/home/index',
          name: 'index',
          component: () => import('../views/home/Index.vue')
        },
        {
          path: '/home/table',
          name: 'table',
          component: () => import('../views/home/Table.vue')
        },
        {
          path: '/home/user',
          name: 'user',
          component: () => import('../views/home/User.vue')
        },
        {
          path: '/home/order',
          name: 'order',
          component: () => import('../views/home/Order.vue')
        },
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    }
  ]
})

export default router
